import { getCurrentSearchList, getProListOfId } from '@/services/product.js';

// eslint-disable-next-line import/no-anonymous-default-export
export default {
  namespace: 'search',
  state: {
    proList: []
  },
  reducers: {
    setProList(state, { payload }) {
      // console.log(payload);
      return {
        ...state,
        proList: payload
      }
    }

  },
  effects: {
    *getSearchList({ payload }, { call, put }) {
      // console.log(payload);
      const res = yield call(getCurrentSearchList, payload);
      // console.log(res);
      yield put({
        type: 'setProList',
        payload: res
      })
    },

  },
}